862d451015f88844f68340186b5001c8bac18a97,view/src/main/java/org/jspresso/framework/view/AbstractViewFactory.java,AbstractViewFactory,createPercentFormat,#IPercentPropertyDescriptor#ITranslationProvider#Locale#,2084

Before Change


                                             ITranslationProvider translationProvider, Locale locale) {
    DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance(locale);
    applyDecimalFormatSymbols(format, propertyDescriptor, translationProvider, locale);
    format.setMaximumFractionDigits(propertyDescriptor.getMaxFractionDigit());
    if (propertyDescriptor.isUsingBigDecimal()) {
      format.setParseBigDecimal(true);
    }
    format.setMinimumFractionDigits(format.getMaximumFractionDigits());
    format.setGroupingUsed(propertyDescriptor.isThousandsGroupingUsed());
    return format;
  }

After Change


    String formatPattern = getOverloadedPattern(propertyViewDescriptor, propertyDescriptor);
    DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance(locale);
    applyDecimalFormatSymbols(format, propertyDescriptor, translationProvider, locale);
    if (formatPattern != null) {
      format.applyPattern(formatPattern);
    } else {
      format.setMaximumFractionDigits(propertyDescriptor.getMaxFractionDigit());
      if (propertyDescriptor.isUsingBigDecimal()) {
        format.setParseBigDecimal(true);
      }
      format.setMinimumFractionDigits(format.getMaximumFractionDigits());
      format.setGroupingUsed(propertyDescriptor.isThousandsGroupingUsed());
    }
    return format;